/*
 *
 * *******************************************************************
 *   @项目名称: BHex Android
 *   @文件名称: AssetListResponse.java
 *   @Date: 11/29/18 3:21 PM
 *   @Author: chenjun
 *   @Copyright（C）: 2018 BlueHelix Inc.   All rights reserved.
 *   注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的.
 *  *******************************************************************
 *
 */

package io.bhex.sdk.trade.bean;

import java.io.Serializable;
import java.util.List;

import io.bhex.baselib.network.response.BaseResponse;
import io.bhex.sdk.account.UserInfo;

/**
 * ================================================
 * 描   述：账户资产
 * ================================================
 */

public class AssetListResponse extends BaseResponse {


    /**
     * accountId : 576251771884127
     * accountName :
     * accountType : 1
     * canTrade : false
     * canDeposit : false
     * canWithdraw : false
     * balance : [{"tokenId":"BTC","tokenName":"BTC","total":"1.41038922943941339","free":"1.36135102","locked":"0.04903820943941339","btcValue":"1.41038923"},{"tokenId":"ETH","tokenName":"ETH","total":"0.01998","free":"0.01998","locked":"0","btcValue":"0.00144607"},{"tokenId":"USDT","tokenName":"USDT","total":"1659.236512865261488165","free":"1093.352086450261488165","locked":"565.884426415","btcValue":"0"}]
     * btcValue : 1.4118353
     */

    private String accountId;
    private String accountName;
    private int accountType;
    private boolean canTrade;
    private boolean canDeposit;
    private boolean canWithdraw;
    private String btcValue;
    private List<BalanceBean> balance;

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public int getAccountType() {
        return accountType;
    }

    public void setAccountType(int accountType) {
        this.accountType = accountType;
    }

    public boolean isCanTrade() {
        return canTrade;
    }

    public void setCanTrade(boolean canTrade) {
        this.canTrade = canTrade;
    }

    public boolean isCanDeposit() {
        return canDeposit;
    }

    public void setCanDeposit(boolean canDeposit) {
        this.canDeposit = canDeposit;
    }

    public boolean isCanWithdraw() {
        return canWithdraw;
    }

    public void setCanWithdraw(boolean canWithdraw) {
        this.canWithdraw = canWithdraw;
    }

    public String getBtcValue() {
        return btcValue;
    }

    public void setBtcValue(String btcValue) {
        this.btcValue = btcValue;
    }

    public List<BalanceBean> getBalance() {
        return balance;
    }

    public void setBalance(List<BalanceBean> balance) {
        this.balance = balance;
    }

    public static class BalanceBean implements Serializable{
        /**
         * tokenId : BTC
         * tokenName : BTC
         * total : 1.41038922943941339
         * free : 1.36135102
         * locked : 0.04903820943941339
         * btcValue : 1.41038923
         */

        private String tokenId;
        private String tokenName;
        private String tokenFullName;
        private String iconUrl;
        private String total;
        private String free;
        private String locked;
        private String btcValue;

        // 是否允许提币
        private boolean allowWithdraw;
        // 是否允许充币
        private boolean allowDeposit;
        private boolean needAddressTag;

        public boolean isNeedAddressTag() {
            return needAddressTag;
        }

        public void setNeedAddressTag(boolean needAddressTag) {
            this.needAddressTag = needAddressTag;
        }

        public String getTokenId() {
            return tokenId;
        }

        public void setTokenId(String tokenId) {
            this.tokenId = tokenId;
        }

        public String getTokenName() {
            return tokenName;
        }

        public void setTokenName(String tokenName) {
            this.tokenName = tokenName;
        }

        public String getTotal() {
            return total;
        }

        public void setTotal(String total) {
            this.total = total;
        }

        public String getFree() {
            return free;
        }

        public void setFree(String free) {
            this.free = free;
        }

        public String getLocked() {
            return locked;
        }

        public void setLocked(String locked) {
            this.locked = locked;
        }

        public String getBtcValue() {
            return btcValue;
        }

        public void setBtcValue(String btcValue) {
            this.btcValue = btcValue;
        }

        public String getTokenFullName() {
            return tokenFullName;
        }

        public void setTokenFullName(String tokenFullName) {
            this.tokenFullName = tokenFullName;
        }

        public String getIconUrl() {
            return iconUrl;
        }

        public void setIconUrl(String iconUrl) {
            this.iconUrl = iconUrl;
        }

        public boolean isAllowWithdraw() {
            if(UserInfo.getUserInfo() != null && UserInfo.getUserInfo().whiteConfig != null)
                return UserInfo.getUserInfo().whiteConfig.canWithdraw;
            return allowWithdraw;
        }

        public void setAllowWithdraw(boolean allowWithdraw) {
            this.allowWithdraw = allowWithdraw;
        }

        public boolean isAllowDeposit() {
            return allowDeposit;
        }

        public void setAllowDeposit(boolean allowDeposit) {
            this.allowDeposit = allowDeposit;
        }
    }
}
